package com.itheima.转码流;

import java.io.*;

public class zmDemo {
    public static void main(String[] args) throws IOException {
        InputStreamReader inpU = new InputStreamReader(new FileInputStream("day623-24CharStream\\xx.txt"), "UTF-8");
        OutputStreamWriter outG = new OutputStreamWriter(new FileOutputStream("day623-24CharStream\\xb.txt"), "GBK");

        //定义临时变量，作为传输的载体
        char[] chars = new char[1024];
        //接收字符数组存储的个数
        int len;

        //循环读写
        while ((len = inpU.read(chars)) != -1) {
            outG.write(chars, 0, len);
        }
        inpU.close();
        outG.close();
    }
}
